package com.llly.pojo;

import java.io.Serializable;
import java.math.BigDecimal;

//购物车实体类
public class ShoppingCar  implements Serializable {
    private Integer id; //自己主键id
    private Integer pid;//商品id
    private Easybuy_product ep=new Easybuy_product();// 产品对象
    private float xiaoji = 0 ;// 小计 商品单价*购买的数量
    private int number = 1;// 数量
    private Integer uid;//用户id
    private Integer isdelete=0;//，默认没有删除
    
    public Integer getIsdelete() {
        return isdelete;
    }
    
    public void setIsdelete(Integer isdelete) {
        this.isdelete = isdelete;
    }
    
    public Integer getId() {
        return id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
    
    public Integer getPid() {
        return pid;
    }
    
    public void setPid(Integer pid) {
        this.pid = pid;
    }
    
    public Integer getUid() {
        return uid;
    }
    
    public void setUid(Integer uid) {
        this.uid = uid;
    }
    
    public float getXiaoji() {
        // 计算金额= 单价*数量
        return getNumber()*ep.getPrice();
    }
    public void setXiaoji(Float xiaoji) {
        this.xiaoji = xiaoji;
    }
    
    public int getNumber() {
        return number;
    }
    
    public void setNumber(int number) {
        this.number = number;
    }
    
    public Easybuy_product getEp() {
        return ep;
    }
    
    public void setEp(Easybuy_product ep) {
        this.ep = ep;
    }
    
    @Override
    public String toString() {
        return "ShoppingCar{" +
                "id=" + id +
                ", pid=" + pid +
                ", ep=" + ep +
                ", xiaoji=" + xiaoji +
                ", number=" + number +
                ", uid=" + uid +
                '}';
    }
}
